package com.southwind.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.southwind.common.Cache;
import com.southwind.common.TreeNode;
import com.southwind.entity.Admin;
import com.southwind.entity.Menu;
import com.southwind.entity.User;
import com.southwind.entity.Worker;
import com.southwind.mapper.MenuMapper;
import com.southwind.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2024-07-04
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuMapper menuMapper;

    @GetMapping("/leftMenu")
    public List<TreeNode> leftMenu(){
        Integer type = (Integer) Cache.map.get("type");
        return this.menuMapper.getMenuByType(type);
    }

}

